#include "testdemo.h"

#include "CUseLog.h"

#pragma comment(lib,"../bin/x64/Debug/CLoggerLibraryEx")

#pragma execution_character_set("utf-8")

testdemo::testdemo(QWidget *parent)
    : QMainWindow(parent), m_logger{}
{
    ui.setupUi(this);
    OnInitDialog();
}

testdemo::~testdemo()
{}

void testdemo::OnInitDialog()
{
    if (Q_NULLPTR == m_logger)
        m_logger = new CLoggerImpl(this);
    Q_CHECK_PTR(m_logger);
    m_logger->InitNormalLog(QString("test"), QString("%1/logs/test.log").arg(QApplication::applicationDirPath()), CLoggerImpl::LogType::LOG_ALL);
    m_logger->WriteDebugMsg(QString("main thread"));
    CUseLog _log(m_logger);
}
